using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Resources;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace KPIS.GERP.Models.SYS
{
    [Table("sys_sc_permissions"), DataContract]
    public class Permission
    {
        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        [DataMember, Display(Name = "PermissionId", ResourceType = typeof(Resources.ScPermissionsResource))]
        [Column("permission_seq")]
        public int PermissionId { get; set; }

        [ForeignKey("Role")]
        [DataMember, Display(Name = "RoleId", ResourceType = typeof(Resources.ScPermissionsResource))]
        [Column("role_seq")]
        public int RoleId { get; set; }

        [ForeignKey("MenuItem")]
        [DataMember, Display(Name = "MenuItemId", ResourceType = typeof(Resources.ScPermissionsResource))]
        [Column("menu_item_seq")]
        public int MenuItemId { get; set; }

        [DataMember, Display(Name = "PermissionType", ResourceType = typeof(Resources.ScPermissionsResource))]
        [Column("permission_type")]
        public string PermissionType { get; set; }

        [DataMember, Display(Name = "RecordStatus", ResourceType = typeof(Resources.ScPermissionsResource))]
        [Column("record_status")]
        public string RecordStatus { get; set; }

        [DataMember, Display(Name = "CreatedBy", ResourceType = typeof(Resources.ScPermissionsResource))]
        [Column("created_by")]
        public Nullable<int> CreatedBy { get; set; }

        [DataMember, Display(Name = "CreatedWhen", ResourceType = typeof(Resources.ScPermissionsResource))]
        [Column("created_when")]
        public Nullable<System.DateTime> CreatedWhen { get; set; }

        [DataMember, Display(Name = "UpdatedBy", ResourceType = typeof(Resources.ScPermissionsResource))]
        [Column("updated_by")]
        public Nullable<int> UpdatedBy { get; set; }

        [DataMember, Display(Name = "UpdatedWhen", ResourceType = typeof(Resources.ScPermissionsResource))]
        [Column("updated_when")]
        public Nullable<System.DateTime> UpdatedWhen { get; set; }

        [DataMember]
        public virtual SYS.Role Role { get; set; }

        [DataMember]
        public virtual SYS.MenuItemsList MenuItem { get; set; }
    }
}
